<div class="layuimini-main" id="access-search">

    <form class="layui-form layui-form-pane" lay-filter="access-search_div_filter">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">人员编号</label>
                <div class="layui-input-inline">
                    <input type="number" max="4294967295" min="1" maxlength="10" name="EmployeeID" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">人员姓名</label>
                <div class="layui-input-inline">
                    <input type="text" maxlength="30" name="EmployeeName" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">卡号</label>
                <div class="layui-input-inline">
                    <input type="number" max="4294967295" min="1" name="EmployeeIC" autocomplete="off" class="layui-input">
                </div>
            </div>

        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">SN</label>
                <div class="layui-input-inline">
                    <input type="text" maxlength="30" name="DeviceID" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">门名称</label>
                <div class="layui-input-inline">
                    <input type="text" maxlength="30" name="DeviceName" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">角色</label>
                <div class="layui-input-inline">
                    <select name="EmployeeRoot" lay-verify="required">
                        <option value="255" selected>不查询</option>
                        <option value="0">用户</option>
                        <option value="1">管理员</option>
                        <option value="2">黑名单</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">上传状态</label>
                <div class="layui-input-inline">
                    <select name="UploadStatus" lay-verify="required">
                        <option value="255" selected>不查询</option>
                        <option value="0">未上传</option>
                        <option value="1">已上传</option>
                        <option value="2">待删除</option>
                    </select>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">上传结果</label>
                <div class="layui-input-inline">
                    <select name="UploadResult" lay-verify="required">
                        <option value="255" selected>不查询</option>
                        <option value="254">已上传，有异常</option>
                        <option value="1">已上传,无异常</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn"><i class="layui-icon">&#xe615;</i> 搜索</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                <button type="submit" class="layui-btn layui-btn-primary" id="btnsearchclose"><i class="layui-icon">&#x1006;</i> 取消</button>
            </div>
        </div>
    </form>

</div>
<script>

    layui.use(['form', 'table', 'faceAPI'], function () {
        var form = layui.form,
            layer = layui.layer,
            table = layui.table,
            $ = layui.$;
        var faceAPI = layui.faceAPI;
        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();

        // 当前弹出层，防止ID被覆盖
        var parentIndex = layer.index;

        if (faceAPI.AccessSearchPageResult != null) {
            form.val("access-search_div_filter", faceAPI.AccessSearchPageResult.field);
        } else
            faceAPI.AccessSearchPageResult = {};

        faceAPI.AccessSearchPageResult.result = false;
        //监听提交
        form.on('submit(data-search-btn)', function (data) {
            var result = data.field;
            if (result.EmployeeIC == "") result.EmployeeIC = 0;
            if (result.EmployeeID == "") result.EmployeeID = 0;


            faceAPI.AccessSearchPageResult.result = true;
            faceAPI.AccessSearchPageResult.field = result;
            layer.close(parentIndex);
            return false;
        });


        $('#btnsearchclose').on('click', function () {
            faceAPI.AccessSearchPageResult.result = false
            layer.close(parentIndex);
            return false;
        });


    });

</script>